import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

class Chapter12Page extends StatelessWidget {
  const Chapter12Page({Key? key}) : super(key: key);

  final _url = 'https://pub.flutter-io.cn';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("第十二章"),
        leading: IconButton(
          icon: const Icon(Icons.home),
          onPressed: () => Navigator.of(context).pushNamed("/"),
        ),
      ),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            children: <Widget>[
              TextButton(
                  onPressed: () => launch(_url),
                  child: const Text("flutter 插件库地址")),
              SelectableText(_url),
            ],
          ),
        ),
      ),
    );
  }
}
